package org.jeecg.modules.demo.traderquota.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.demo.traderquota.entity.PostorderPrice;
import org.jeecg.modules.demo.traderquota.entity.TraderQ;

import java.util.List;

@Mapper
public interface TraderQMapper extends BaseMapper<TraderQ> {


    @Select("select POPRICE,POQUANTITY,TIANSHU from POSTORDER where POTRADERID=#{potraderid} and ISVALID = 1 and POSTTYPE != 'tqzc' and POPRICE IS NOT NULL and POSTATUS in (1,2,3,4,5)")
    List<PostorderPrice> countTotal(Integer potraderid);


    @Update("UPDATE TRADER SET QUOTA_TOTAL = #{quota} WHERE SYSID = #{id}")
    void updateTraderQById(Integer id, Double quota);
}
